import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-01-30
 * Time: 10:08
 */
class Solution1 {
    public void hanota(List<Integer> a, List<Integer> b, List<Integer> c) {
        dfs(a,b,c,a.size());
    }
    public void dfs(List<Integer> a, List<Integer> b, List<Integer> c,int n){
        if(n == 1){
            c.add(a.remove(a.size()-1));
            return;
        }
        dfs(a,c,b,n-1);
        c.add(a.remove(a.size()-1));//这里不能写成a.get(0),因为需要移除来在，放进去
        // c.add(a.get(0));
        dfs(b,a,c,n-1);
    }
}
public class Test1 {
}
